package com.lemobar.pay.model.epay.response;

import lombok.Data;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.core.Persister;

@Data
@Root(name = "OrderInfo", strict = false)
public class OrderInfo {

    /**
     * 商户订单号
     */
    @Attribute(name = "BillNo")
    private String BillNo;

    /**
     * 双乾流水号
     */
    @Attribute(name = "OrderNo")
    private String OrderNo;

    /**
     * 支付订单号
     */
    @Attribute(name = "bankOrderNo")
    private String bankOrderNo;

    /**
     * 订单金额
     */
    @Attribute(name = "amount")
    private String amount;


    /**
     * 交易时间
     */
    @Attribute(name = "Date")
    private String Date;

    /**
     * 订单状态
     *  0	失败
     *  1	成功
     *  2	待处理
     *  3	取消
     *  4	结果未返回
     */
    @Attribute(name = "State")
    private String State;


    @Attribute(name = "IsSettlement")
    private String IsSettlement;
    @Attribute(name = "cardType")
    private String cardType;
    @Attribute(name = "signature")
    private String signature;
    @Attribute(name = "MD5ResultInfo")
    private String MD5ResultInfo;


    public static void main(String[] args) throws Exception {
        String xmlData = "<Epay95>\n" +
                "    <!--双乾支付单笔订单查询接口返回结果-->\n" +
                "    <MerInfo MerNo=\"200902\" BillNo=\"1000001\" message=\"查询成功\" ResultCode=\"1\" OrderNUM=\"7\">\n" +
                "        <!--返回信息-95epay-->\n" +
                "        <OrderInfo BillNo=\"1000001\" OrderNo=\"2009022111221946302284364\" bankOrderNo=\"\" amount=\"0.01\" Date=\"2021-11-22 19:46:30.0\" State=\"3\" IsSettlement=\"0\" cardType=\"\" signature=\"mfENtuP4Rt0Yx1vA4liFmwg58yLZQ4LdA6iQq18ri6FYD9HJ1H42KdSThLXdhKsMHVNm3tFqm0HjjNGkV6Iqvr/PwC9K2DGt6cNfouuDT12azVlzRczFRVgwuEKy+sQRgDkjXb586ghDz5o3exYYsfXRrpReUzhoycZUvHimKiM6XS1kfbdijAovw9ohofYimOQqJekjctusB4MLxpMwQZo1UlGOHndKvZCXhCDg3dNYOuiA7UYITTGf7cZAV7qKQVQbay41nZp9UrtEUj5KwVHFuAHTuW3A3BYY/i6hoiu147itavjmSVQtq6Wn+alOwrGYtMW6GEVLnbkLecZWgg==\" MD5ResultInfo=\"AB95CCAB25F0F1C54EF200C7D36BCC85\"/>\n" +
                "        <OrderInfo BillNo=\"1000001\" OrderNo=\"2009022111221859203576264\" bankOrderNo=\"\" amount=\"0.01\" Date=\"2021-11-22 18:59:20.0\" State=\"3\" IsSettlement=\"0\" cardType=\"\" signature=\"fWMsyNnZ7ImhonwA6uLnNEKG8+l1kiI8t6cnpO+jiYfUoFygiyWhHho0KEOcTGw0MiqhbHvlPehMn2oZkuN3VvoT+8z/WMi2FSrdFW3KLbX7rqrqB0GNQ/32qbkKz75g+PLAtv0KEF+TwUOD3p4HsFYofJHodYUd6GRSx4Quj2dNf0MDe/LTtTF96nnW54dIgLILbubM9OeRvT0dvaYo0sgEanmlom7vTxx2bnLtUbvfCIG61L92iPraHIC4zPfMhq4XCtTqm3wjsYjIVvhpDn+XodmvtYgTzrcAgJMCaLfEgGOk2YQIKXqsPF95plCpX7H1OZS4YDVYl2XgdCtItQ==\" MD5ResultInfo=\"D2AEE122B3475E553DC9E2C6D4C79DD9\"/>\n" +
                "        <OrderInfo BillNo=\"1000001\" OrderNo=\"2009022111221941568007474\" bankOrderNo=\"\" amount=\"0.01\" Date=\"2021-11-22 19:41:56.0\" State=\"3\" IsSettlement=\"0\" cardType=\"\" signature=\"VA0xzaoEm8tLb8EaRW4nN8Qh+iimBos2L45TR/EELdAlCerc4P5L7IOkO1ZRqumQSOFj9Vt2+afJhO2Iun6MrRC75zDFKG8QGnIWJDFyJG8eZ7/0IEzDKvih7HOlRuOcFn4r9e3Qg6V3Z3bqAoptA/BxEt+WsCR7MIVTXy42nzX9c6d8ReAiWu1YvwpEZJUrhqzPWcdYJ9XkkunYDRFf/dKfxF2rj4TNd8UipQ61DtV6NNO7CIYrBAShOW9yyMv9QjKR/RE3OnWkWP/r1eE0ArmgkGaWoPUXe7FchvAHabil217PhOwVUm/Jti4Kj/CGzlMTXBgJd3fzgWCDJS+xaw==\" MD5ResultInfo=\"1B31779DBF81231870B2504F38D69B5E\"/>\n" +
                "        <OrderInfo BillNo=\"1000001\" OrderNo=\"200902211122194329323641\" bankOrderNo=\"\" amount=\"0.01\" Date=\"2021-11-22 19:43:02.0\" State=\"3\" IsSettlement=\"0\" cardType=\"\" signature=\"kCRgoCkJOnK8BAlaSkDz2NCQhf7e5xkzuYv4SCyDpM+rusnW9GqPEkpax5uSsYvMDaNpKWbY3wuzinlpiebix/lBR/NJNsuJCo93RivTyNvxczvCSQOn3NmXOm3pCWpnpmY33aLYhXC+WRLhD+PBejysUir9BfpLq9LM97/H4Z2gzth3CHVNnSXyLpvrHxOtKBD1MmKx3zHQKLSsISSENK6JCL6GiOQR9mLlueYpXq1Y0dLXAySBTUcWKrZKbjOCPlu5x2NR6F+fnAtQK7TTQ6T8TIsjWIumn77zN1J2b6PEXXf85hGm80c1qRFL1s5Nm7FgwwKSEEBL4bGeeBFrxg==\" MD5ResultInfo=\"5CB2EF8D81293A5B55C52EC3DEB16BD1\"/>\n" +
                "        <OrderInfo BillNo=\"1000001\" OrderNo=\"2009022111221944169118665\" bankOrderNo=\"\" amount=\"0.01\" Date=\"2021-11-22 19:44:16.0\" State=\"3\" IsSettlement=\"0\" cardType=\"\" signature=\"noSm+LQYL9sWoT5gUuGh+T45y4/fgN0fmDGGIonzIpSbDF5APOtQpiuFKy+QyI/QL2jH7aezJVv4R8RLYPTy5eHYw4a4+LhYwQovKB4gOpcQehlUx++1y6M5leaerQ/1JTzfOUkWM9hIx3rxgS6m4nWD7zTSF5Kk/JCBoJB+3ZrUTWGATF9qThuiNmzyyiaZObKC5fLS4XleozmQwJeTRL/8OACLbQIrj6EfUe9aqAaqry/I2xcHiw0QqTxYAPyWqjASKSVQa/zurLSIa5SN3GQdCO5/gLGJjBR1UPVqsCEmuYDJki17bYofFVFMNp0MdJWm4I5SCZsjM74cyIC76A==\" MD5ResultInfo=\"6DCB75DC5FC8ED4A52EEABDDD4296CDA\"/>\n" +
                "        <OrderInfo BillNo=\"1000001\" OrderNo=\"200902211122192549160124\" bankOrderNo=\"\" amount=\"0.01\" Date=\"2021-11-22 19:02:54.0\" State=\"3\" IsSettlement=\"0\" cardType=\"\" signature=\"ILQlFz8mgPwlIJXwbS48csP+V0Flm6gTtaVj4QTB7Xg67zlWxn+qs/eVUhnWshk1fyYMvdLqmpbagHwG+D6NHIbtBcipIP3yP85VgGZDZrnzeX4LQ5voThOOuLydDuuWpG77qivMqAq/9CMd8W0cqn28qiI4fJ9pttVIuevNE7RcsJj5lIexI7E9dEWMMYiGmj5dShvUHgt3pfjdv7AQuSKN4/+jI6fLOZ7tYNH6Lixv6x8Asg2FcfsN/FPOjZc3OQGsxqgdMJdB3K3hz89+E9HgOWDepjzpp4iykGdIKIA6nUlpgqISzLWuP+YrBwoRexIim0voBzH8/LVyFEG4pA==\" MD5ResultInfo=\"8EC978204BBCEE6D263D3A62FF7E95DE\"/>\n" +
                "        <OrderInfo BillNo=\"1000001\" OrderNo=\"200902211122191439083442\" bankOrderNo=\"\" amount=\"0.01\" Date=\"2021-11-22 19:01:43.0\" State=\"3\" IsSettlement=\"0\" cardType=\"\" signature=\"Lq5lVxLrVuNADy41nbHiWmmm3F6dPTHKbN4h7Npbb6NS9pDfY5XAL0yswHnBiDJrdQA+VhToCwQwe8ZIgKT8iqnoIvkSi06wKhy/hEuQunA9Y1Aba8qk2HuvLtYx4Uw+UirLZkZX2iPlBRzoGrdO/mb2sbhuEmzHNF2fNqsS7sWnVNlDxGCrFWuuiot9RbJ5yj8RFQOeSaBn/5lrqW4ptvfw0NJFGP/vOrvm7ABKyQLZ6Ydd8/+EN3QTA4H5nWWCV+nv7QZyBWFkhYfQSa50xIKe2IPDt/rdBE0x5aLNHOaKdPnWx4mzVX4IRvzbsxxyNthoSYG3mHpAnDI/2cDjbw==\" MD5ResultInfo=\"3CAC96C17673D02FC32A109F076FA868\"/>\n" +
                "    </MerInfo>\n" +
                "</Epay95>";
        Persister persister = new Persister();
        EPayQueryResponse read = persister.read(EPayQueryResponse.class, xmlData, false);
    }
}
